<!DOCTYPE html>
<html lang="en">
<!--by czt-->
<head>
    <meta charset="UTF-8">
    <title>图书管理系统</title>
    <link rel="stylesheet" href="css/iconfont.css">
    <link rel="stylesheet" href="css/reader_searchbook.css">
    <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.js"></script>
    <script type="text/javascript">
        function getQueryString(name)
        {
            var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
            var r = window.location.search.substr(1).match(reg);
            if(r!=null)return  unescape(r[2]); return null;
        }
        var phone = getQueryString("phone");
        function searchbook(){
            var book = $("[name=bookname]").val();
            var rname = $("#name").html();
            if(book != ""){
                window.location.href = "/reader_search_result_in?bname=" + book + "&rname=" + rname + "&phone="+phone;
            }else{
                $("#message").html("The book name cannot be empty!");
                $("#tanchuceng").css("display","block");
            }
        }
        function exit(){
            $("#tanchuceng").css("display","none");
        }

        function home(){
            var name = getQueryString("name");
            $("#home").attr("href","/welcome?name=" + name + "&phone="+phone);
        }

        $(function () {
            var label = getQueryString("name");
            $("#name").html(label);
        })
    </script>
</head>
<body>
<header class="header clearfix">
    <i class="iconfont icon-yun"></i>
    <i>Library</i>
    <i class="iconfont icon-yonghu"></i>
    <i id="name"></i>
    <a href="/reader_searchbook(no)" class="logout">Logout</a>
    <ul class="topmenu clearfix">
        <li><a href="/notice/to">Public Notice</a></li>
        <li>
            <a href="">language</a>
            <div class="submenu">
            </div>
        <li>
        <a id="home" onclick="home()" style="cursor: pointer">Reader Home</a>
    </li>
    </ul>
</header>
<div class="main clearfix">
    <div>
        <p style="text-align: center; font-size: 50px;font-weight: bold; font-family: Pristina;  margin-top: 15%;">
            Books are the ladder of human progress——Gorky
        </p>
        <div class="search-box">
            <i class="iconfont icon-sousuo"></i>
            <input type="text" name="bookname" placeholder="Type to search" required >
            <button id="btn" onclick="searchbook()">Search</button>
        </div>

    </div>

    <footer class="footer">
        <div class="mandarin">
            <img src="images/mandarin.png" alt="">
        </div>
        <p>Shan ICP number18018134 | Powered by 1713011</p>
    </footer>
</div>
<div id="tanchuceng">
    <div id="msg">
        <div id="exit" onclick="exit()">x</div>
        <p id="message"></p>
    </div>
</div>
</body>
</html>